package com.yygo.jobs;

import com.yygo.model.LoanPerson;
import com.yygo.model.LoanRequest;
import com.yygo.model.Rule;
import com.yygo.service.LoanRequestManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by tiansha on 2015/7/4.
 */
@Component("D103")
public class D103 implements RuleProcessor {

    @Autowired
    private LoanRequestManager loanRequestManager;

    @Override
    public Rule process(LoanRequest loanRequest) {
        LoanPerson requestPerson = loanRequest.getRequestPerson();
        if (requestPerson.getAge() >= 60 && requestPerson.getAge() <= 70 && (loanRequest.getDbPerson() == null || !loanRequest.isGuaranted()) && loanRequest.getDownPaymentRate() < 50) {
            Rule rule = new Rule("D103", "需要子女做担保人");
            return rule;
        }
        return null;
    }

}